<?php
class SanPhamLienQuanWidget extends CWidget
{	
	public $product;
	public function init()
	{
	}
	
	public function run()
	{
		$cri = new CDbCriteria;
		$cri->condition = 'category_id=:category_id AND id<>:id AND visible = 1';
		$cri->params = array(':category_id'=>$this->product->category_id,':id'=>$this->product->id);
		$cri->order = 'sort ASC, id DESC';
		// $cri->limit = 6;
		$products = ProductDetail::model()->findAll($cri);

		$this->render('viewSanPhamLienQuanWidget',array('products'=>$products));	
	} 
}